<template>
  <el-dialog
    class="classInformation"
    :title="''"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <NavigationBar
      :navtitle="'资讯列表>资讯详情'"
      @navEvent="navEvent"
    ></NavigationBar>
    <div style="padding:0 10px">
      <div class="title">标题：{{info.title}}</div>
      <div class="time"> 分类：{{info.categoryName}}</div>
      <div class="time"> 状态：{{info.status==1?'有效':'无效'}}</div>
      <div class="time"> 主推：{{info.recommend==0?'是':'否'}}</div>
      <div class="time"> 留言奖励积分：{{info.messageScore}}</div>
      <div class="time"> 初始阅读量：{{info.viewInitCount }}</div>
      <div class="time"> 资讯主图： <img :src="info.banner" alt=""> </div>
      <div class="time"> 详情： <div class="cont" v-html="info.content"></div></div>
    </div>
  </el-dialog>
</template>

<script>
  export default {
    components: {
      NavigationBar: () => import('../../components/navigationBar/index.vue')
    },
    data () {
      return {
        visible: false,
        info: {}
      }
    },
    methods: {
      navEvent () {
        this.visible = false
      },
      init (id) {
        this.visible = true
        this.$nextTick(() => {
          if (id) {
            this.$http({
              url: this.$http.adornUrl(`/admin/information/getInformationInfo?informationId=${id}`),
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === '200') {
                this.info = data.data
              }
            })
          }
        })
      }
    }
  }
</script>
<style lang="scss">
  .classInformation{
    .el-dialog__header{
      display: none;
    }
  }
</style>
<style lang="scss" scoped>

  .title{
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
  }
  .time{
    color: #999;
    font-size: 14px;
    margin-top: 10px;
    display: flex;
  }
  .cont{
    margin-top: 15px;
  }
</style>
